<?php

class m121202_063849_create_axe_table extends CDbMigration
{
	public function up()	{
		$this->createTable('axe', array(
         'id'       => 'serial NOT NULL',
         'name'     => 'varchar(30) NOT NULL',
         'fullname' => 'varchar(300)',
			'left'     => 'integer',
			'right'    => 'integer',
			'level'    => 'integer',
			'parent'   => 'integer',
			'root'     => 'integer'
      ));
		$this->createIndex('axe_pk', 'axe', 'id', true);
		
		$this->createTable('value', array(
         'id'       => 'serial NOT NULL',
         'axis'     => 'integer[][]',
         'data'     => 'varchar(50)'
      ));
		$this->createIndex('value_pk', 'value', 'id', true);
	}
	
	public function down()
	{
		$this->dropTable('axe');
		$this->dropTable('value');
	}

	/*
	// Use safeUp/safeDown to do migration with transaction
	public function safeUp()
	{
	}

	public function safeDown()
	{
	}
	*/
}